package hummer.domain;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 14-8-24
 * Time: 下午10:38
 * To change this template use File | Settings | File Templates.
 */
public class Recorder {

    private String key;
    private AtomicInteger count;
    private int threshold;

    public Recorder(String key, int threshold) {
        this.key = key;
        this.threshold = threshold;
        this.count = new AtomicInteger(0);
    }

    public void increase() {

        count.incrementAndGet();

    }

    public void decrease() {

        count.decrementAndGet();

    }

    public String getKey() {
        return key;
    }

    public int getThreshold() {
        return threshold;
    }
}
